package com.lee.forum.exception;

import com.lee.forum.common.AppResult;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lishuo
 * Date: 2023-09-26
 * Time: 21:51
 */
// 自定义异常
public class ApplicationException extends RuntimeException {
    // 自定义错误
    protected AppResult errorResult;

    public AppResult getErrorResult() {
        return errorResult;
    }

    // 指定状态码，异常描述
    public ApplicationException(AppResult errorResult) {
        super(errorResult.getMessage());
        this.errorResult = errorResult;
    }

    public ApplicationException(String message) {
        super(message);
    }

    public ApplicationException(String message, Throwable cause) {
        super(message, cause);
    }

    public ApplicationException(Throwable cause) {
        super(cause);
    }
}
